/****************************************************************************
**  Tite Interactive Text Engine (TiTE)
**  Copyright (C) 2010  Eisoft Group
**
**  This file is part of TiTE.
**
**  TiTE is free software: you can redistribute it and/or modify
**  it under the terms of the GNU General Public License as published by
**  the Free Software Foundation, either version 3 of the License, or
**  (at your option) any later version.
**
**  TiTE is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
**  GNU General Public License for more details.
**
**  You should have received a copy of the GNU General Public License
**  along with TiTE.  If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/

/*!
 * \file configuration_TR1.hpp
 *
 * \date 01/10/2011
 */

#ifndef TITE_CONFIGURATION_TR1_HPP
#define TITE_CONFIGURATION_TR1_HPP

#include <boost/preprocessor/cat.hpp>

///! Detect whether the compiler has TR1 within the proper std namespace or not.
#ifdef _MSC_VER
#   if _MSC_VER < 1600
#       define _TITE_USE_TR1_NAMESPACE
#       define _TITE_TR1_NAMESPACE ::std::tr1
#   else
#       define _TITE_TR1_NAMESPACE ::std
#   endif /* _MSC_VER */
#elif defined GCC_VERSION
#   define _TITE_USE_TR1_NAMESPACE
#   define _TITE_TR1_NAMESPACE ::std::tr1
#endif /* GCC_VERSION */

///! TR1 is located within a sub-path for certain compilers
#ifdef _TITE_USE_TR1_NAMESPACE
#   define _TITE_TR1_PATH tr1/
#else
#   define _TITE_TR1_PATH
#endif /* _TITE_USE_TR1_NAMESPACE */

#define TITE_INCLUDE_TR1(HEADER) BOOST_PP_CAT(<, BOOST_PP_CAT(_TITE_TR1_PATH, BOOST_PP_CAT(HEADER, >)))

/*!
 * \namespace tite
 *
 * \brief The TiTE namespace.
 */
namespace tite
{
    /*!
     * \namespace stdext
     *
     * \brief The stdext namespace.
     */
    namespace stdext
    {
#if defined(_TITE_TR1_NAMESPACE) && (defined(_TITE_USE_TR1_NAMESPACE) || !defined(_TITE_STL_NAMESPACE))
        using namespace _TITE_TR1_NAMESPACE;
#elif !defined(_TITE_TR1_NAMESPACE)
#   error _TITE_TR1_NAMESPACE undefined! See include/tite/configuration_TR1.hpp for details.
#else
        // Do nothing, tr1 is a part of the std namespace in this case.
#endif /* _TITE_TR1_NAMESPACE */
    }// End of stdext namespace
}// End of tite namespace

#endif /* TITE_CONFIGURATION_TR1_HPP */